import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ReactivityTransform from '@vue-macros/reactivity-transform/vite'
import AutoImport from 'unplugin-auto-import/vite'

export default defineConfig({
    root: './src',
    resolve: {
        alias: {
            '@': '/src'
        },
        extensions: ['.js', '.json', '.ts', '.vue']
    },
    plugins: [
        vue(),
        ReactivityTransform(),
        AutoImport({
            imports: ['vue'],
            dts: './types/auto-imports.d.ts',
        })
    ],
    server: {
        port: 3000,
        open: true
        // proxy: {
        //     '/api': {
        //         target: 'http://localhost:8080',
        //         changeOrigin: true,
        //         rewrite: (path) => path.replace(/^\/api/, '')
        //     }
        // }
    }
})